import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/home",
    component: () => import("@/views/Home.vue"),
    meta: { title: "自述文件" },
    children: [
      {
        path: "info",
        component: () => import("@/views/InfoPage.vue"),
        meta: { title: "Info" },
      },
      {
        path: "singer",
        component: () => import("@/views/SingerPage.vue"),
        meta: { title: "Singer" },
      },
      {
        path: "song",
        component: () => import("@/views/SongPage.vue"),
        meta: { title: "Singer" },
      },
      {
        path: "songlist",
        component: () => import("@/views/SongListPage.vue"),
        meta: { title: "SongList" },
      },
      {
        path: "listsong",
        component: () => import("@/views/ListSongPage.vue"),
        meta: { title: "ListSong" },
      },

      {
        path: "consumer",
        component: () => import("@/views/ConsumerPage.vue"),
        meta: { title: "Consumer" },
      },
      {
        path: "comment",
        component: () => import("@/views/CommentPage.vue"),
        meta: { title: "Comment" },
      },
      {
        path: "collect",
        component: () => import("@/views/CollectPage.vue"),
        meta: { title: "Collect" },
      },
    ],
  },
  {
    path: "/",
    component: () => import("@/views/Login.vue"),
  },
];

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes,
});

export default router;
